home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 031a / stsbar.zip / STSBAR.TXT < prev   
Text File  |  1991-09-12  |  18KB  |  827 lines

  1.  
  2.  
  3.  
  4.  Status Bar Control
  5. Version 1.1.0
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37. Jean-Marc Krikorian
  38. September 12, 1991
  39. Copyright 1991. All Rights Reserved.
  40.  
  41. The Status Bar Control DLL is a shareware product. I welcome any suggestions, comments or questions you may have on this product. The source code is also available. Please direct all requests to the address or telephone number below.
  42.  
  43.  
  44.  
  45. Jean-Marc Krikorian
  46. 525 Sandy Lane
  47. Libertyville, IL  60048
  48. (708) 816-3314
  49.  
  50.  
  51.  
  52. The Status Bar DLL contains three files:
  53.  
  54. 1.) STSBAR.LIB. This is the import library that has to be link in with your exe.
  55. 2.) STSBAR.EXT. This is the external header file that contains the message IDs and the function prototypes.
  56. 3.) STSBAR.DLL. This is the Status Bar DLL. Make sure it resides in your current directory or in a directory pointed to by your PATH environmental variable.
  57.  
  58. A sample application SBTEST.* is included along with its source. Refer to it when building your application. The sample application comes with a makefile to show how to link with the Status Bar DLL.
  59.  
  60. Introduction:
  61.  
  62. The Status Bar control defines a new window class. This window class as the name implies creates a status bar. The status bar is used to display messages to the user and/or to display current information. For an example refer to Microsoft Word for Windows. As long as the user does not interact with the menu bar the status bar displays such information as the page number and section number. However, when the user interacts with the menu bar the status bar displays more verbose information specific to each menu option.
  63.  
  64. Technical Issues:
  65.  
  66. The Status Bar by virtue of it being a control was implemented such that it is re-entrant. This means that the programmer can create multiple Status Bar controls within one application and that more than one application can have a Status Bar control. Think of the Status Bar control as a pushbutton. A dialog box can have many pushbuttons within it yet each pushbutton is unique in the sense that different actions can occur by selecting different pushbuttons. The way to differentiate between the different controls is through either their unique IDs or unique handles. To get a Status Bar the user must perform a CreateWindow() call using the class name "StatusBar" and a unique ID. Each CreateWindow() call will return a unique handle for that particular Status Bar control. As a result, by storing these handles the user can access multiple Status Bars.
  67.  
  68. The Status Bar attributes of Face Style, Face Color and Text Color will only work on a monitor that is 16 color VGA or better. The reason is that on monitors of lesser resolution and color capabilities the dithering causes the Status Bar Face Styles to be rather unattractive. Therefore, for these monitors, the Status Bar exhibits a white flat face and black text.
  69.  
  70. Status Bar Features:
  71.  
  72. With the Status Bar control you are able to:
  73.  
  74. 1.) Choose a location for the control (Top, Bottom or Moveable)
  75. 2.) Pick the Face Style (3D, 2D or Flat)
  76. 3.) Pick the Face Color (Any RGB value)
  77. 4.) Pick the Font Family and Point Size
  78. 5.) Pick the Text Color (Any RGB value)
  79. 6.) Pick the Text Attributes (Bold, Italic, Underline and/or StrikeOut)
  80. 7.) Receive mouse click notification messages
  81.  
  82. Accessing the Status Bar Control:
  83.  
  84. To access the Status Bar control the following steps have to be taken:
  85.  
  86. 1.) Include the header file "STSBAR.EXT". This header file contains the function prototypes that are needed and all the various messages and message parameters that are available.
  87.  
  88. 2.) Before creating the window class make a call to StatusBarInit(hInstance). This function registers the Status Bar class if it is not already registered.
  89.  
  90. 3.) Call the Windows function CreateWindow() and use the class name "StatusBarClass". Also, make sure to pass in a unique ID number, since this will be used to access notification messages that are passed back. The Status Bar window can be created with one of two styles:
  91.  
  92. a.) the SBS_BOTTOM style creates a Status Bar that will always be at the bottom of the parent's client area.
  93.  
  94. b.) the SBS_TOP style creates a Status Bar that will always be at the top of the parent's client area.
  95.  
  96. c.) the SBS_MOVEABLE style creates a Status Bar which can have a user chosen y-origin. (see related information in the SBM_SETFONT and SBM_SIZE messages).
  97.  
  98. 4.) In the WM_SIZE message send the Status Bar an SBM_SIZE message and pass in the parent's size (which is contained in the lParam) as the lParam to the SendMessage() call. (i.e. SendMessage(hStatusBar, SBM_SIZE, 0, lParam)). (For a Status Bar created with the SBS_MOVEABLE style, the wParam should contain the Status Bar's y-origin.)
  99.  
  100. 5.) In the WM_DESTROY message make a call to StatusBarUnInit(hInstance). This function will unregister the Status Bar class.
  101.  
  102. Status Bar Messages
  103.  
  104. SBM_DISPLAYTEXT
  105.  
  106. This message is used to display text inside the Status Bar.
  107.  
  108. Parameter
  109. Description
  110.  
  111.  
  112.  
  113.  
  114. wParam
  115. Contains text attributes that can be 'Or'ed together. The values are
  116. 1.) SBTA_BOLD
  117. 2.) SBTA_ITALICS
  118. 3.) SBTA_UNDERLINE
  119. 4.) SBTA_STRIKEOUT
  120.  
  121.  
  122.  
  123.  
  124. lParam
  125. Contains a LPSTR to the text to be displayed.
  126.  
  127.  
  128.  
  129. Example
  130. SendMessage(hStatusBar, SBM_DISPLAYTEXT, (WORD)(SBTA_BOLD | SBTA_UNDERLINE), (LONG)(LPSTR)"This is some text.");
  131.  
  132.  
  133.  
  134. Comments
  135. The font used to display the text will be the current system font in use by Windows.
  136. The Status Bar control will store its own copy of the text, so that the user does not have to bother with repaints to the Status Bar.
  137. The default is to display the text without any of these attributes.
  138. The text passed in can be any length, however, it will be clipped within the client area of the Status Bar.
  139.  
  140.  
  141.  
  142. Return Value
  143. None
  144.  
  145.  
  146. Status Bar Messages continued...
  147.  
  148. SBM_FACECOLOR
  149.  
  150. This message is used to change the color of the display face of the Status Bar.
  151.  
  152. Parameter
  153. Description
  154.  
  155.  
  156.  
  157.  
  158. wParam
  159. Not used.
  160.  
  161.  
  162.  
  163.  
  164. lParam
  165. Can contain either one of the Status Bar color defines in the header file, currently these are:
  166. 1.) SBCLR_RED
  167. 2.) SBCLR_GREEN
  168. 3.) SBCLR_WHITE
  169. 4.) SBCLR_BLACK
  170. 5.) SBCLR_GRAY
  171.  
  172. Yet, if you look at the definitions for these constants you will see that they are actually instances of the Windows macro RGB(r,g,b). As a result, the lParam can contain this RGB() macro with any values in it and these values will be used to display the face color.
  173.  
  174.  
  175.  
  176. Example
  177. SendMessage(hStatusBar, SBM_FACECOLOR, 0, (LONG)SBCLR_BLUE); 
  178. or
  179. SendMessage(hStatusBar, SBM_FACECOLOR, 0, (LONG)RGB(50, 175, 210));
  180.  
  181.  
  182.  
  183. Comments
  184. The default face color is white.
  185.  
  186.  
  187.  
  188. Return Value
  189. Returns the previous face color.
  190.  
  191.  
  192. Status Bar Messages continued...
  193.  
  194. SBM_FACESTYLE
  195.  
  196. This message is used to change the face style Status Bar.
  197.  
  198. Parameter
  199. Description
  200.  
  201.  
  202.  
  203.  
  204. wParam
  205. Not used.
  206.  
  207.  
  208.  
  209.  
  210. lParam
  211. Contains one value for the face style. These styles should not be 'Or'ed together.
  212. 1.) SBFS_3DFACE
  213. 2.) SBFS_2DFACE
  214. 3.) SBF_FLATFACE
  215.  
  216.  
  217.  
  218. Example
  219. SendMessage(hStatusBar, SBM_FACESTYLE, 0, SBFS_3DFACE);
  220.  
  221.  
  222.  
  223. Comments
  224. The default is SBFS_FLATFACE.
  225.  
  226.  
  227.  
  228. Return Value
  229. Return the previous face style.
  230.  
  231.  
  232. Status Bar Messages continued...
  233.  
  234. SBM_SETFONT
  235.  
  236. This message is sent to the Status Bar to tell it to tell it to display a particular font and point size.
  237.  
  238. Parameter
  239. Description
  240.  
  241.  
  242.  
  243.  
  244. wParam
  245. Only used with a Status Bar created with the SBS_MOVEABLE style. If the control is defined with such a style then the wParam should contain the y-origin.
  246.  
  247.  
  248.  
  249.  
  250. lParam
  251. Contains the address to a LOGFONT structure that contains the font information. When the Status Bar is first created and if no particular font is selected, then the Status Bar selects the default system font to display text.
  252. To reset the Status Bar so that it uses the default system font set lParam to zero.
  253.  
  254.  
  255.  
  256. Example
  257. SendMessage(hStatusBar, SBM_SETFONT, 0, (LONG)(LPLOGFONT)&lf);
  258.  
  259. To reset the Status Bar so that it uses the default system font the following is done:
  260. SendMessage(hStatusBar, SBM_SETFONT, 0, 0L);
  261.  
  262. If the Status Bar is created with the SBS_MOVEABLE style then use:
  263. SendMessage(hStatusBar, SBM_SETFONT, (WORD)yorigin, (LONG)(LPLOGFONT)&lf);
  264.  
  265.  
  266.  
  267. Comments
  268. Only two fields in the log font structure are used these are:
  269. 1.) lf.lfHeight
  270. 2.) lf.lfFaceName
  271.  
  272.  
  273.  
  274. Return Value
  275. None
  276.  
  277.  
  278. Status Bar Messages continued...
  279.  
  280. SBM_SIZE
  281.  
  282. This message is sent to the Status Bar to tell it to resize itself. This message should be sent from inside the WM_SIZE message of the parent, since the Status Bar sizes itself with respect to the width of the parent.
  283.  
  284. Parameter
  285. Description
  286.  
  287.  
  288.  
  289.  
  290. wParam
  291. Only used with a Status Bar created with the SBS_MOVEABLE style. If the control is defined with such a style then the wParam should contain the y-origin.
  292.  
  293.  
  294.  
  295.  
  296. lParam
  297. Contains the new width and height of the client area of the window. Refer to WM_SIZE in the SDK manual.
  298. If this message is called from within the parent's WM_SIZE pass in the lParam, since it already contains the parent's size. Otherwise you must determine the size of the parent and pass that value in.
  299.  
  300.  
  301.  
  302. Example
  303. SendMessage(hStatusBar, SBM_SIZE, 0, (LONG)lSize);
  304.  
  305. If the Status Bar is created with the SBS_MOVEABLE style then use:
  306. SendMessage(hStatusBar, SBM_SIZE, (WORD)yorigin, (LONG)lSize);
  307.  
  308.  
  309.  
  310. Comments
  311. None
  312.  
  313.  
  314.  
  315. Return Value
  316. None
  317.  
  318.  
  319. Status Bar Messages continued...
  320.  
  321. SBM_TEXTCOLOR
  322.  
  323. This message is used to change the color of the display text inside the Status Bar.
  324.  
  325. Parameter
  326. Description
  327.  
  328.  
  329.  
  330.  
  331. wParam
  332. Not used.
  333.  
  334.  
  335.  
  336.  
  337. lParam
  338. Can contain either one of the Status Bar color defines in the header file, currently these are:
  339. 1.) SBCLR_RED
  340. 2.) SBCLR_GREEN
  341. 3.) SBCLR_WHITE
  342. 4.) SBCLR_BLACK
  343. 5.) SBCLR_GRAY
  344.  
  345. Yet, if you look at the definitions for these constants you will see that they are actually instances of the Windows macro RGB(r,g,b). As a result, the lParam can contain this RGB() macro with any values in it and these values will be used to display the text color.
  346.  
  347.  
  348.  
  349. Example
  350. SendMessage(hStatusBar, SBM_TEXTCOLOR, 0, (LONG)SBCLR_BLUE); 
  351. or
  352. SendMessage(hStatusBar, SBM_TEXTCOLOR, 0, (LONG)RGB(50, 175, 210));
  353.  
  354.  
  355.  
  356. Comments
  357. The font used to display the text will be the current system font in use by Windows.
  358. The Status Bar control will store its own copy of the text, so that the user does not have to bother with repaints to the Status Bar.
  359. The default text color is black.
  360.  
  361.  
  362.  
  363. Return Value
  364. Returns the previous text color.
  365.  
  366.  
  367. Status Bar Notification Messages
  368.  
  369. SBN_LBUTTONDBLCLK
  370.  
  371. This code specifies that the Status Bar control received a left button double-click. The parent receives this code through the WM_COMMAND message from the control.
  372.  
  373. Parameter
  374. Description
  375.  
  376.  
  377.  
  378.  
  379. wParam
  380. Specifies the control ID of the Status Bar.
  381.  
  382.  
  383.  
  384.  
  385. lParam
  386. Contains the SBN_LBUTTONDBLCLK code in the high-order word.
  387.  
  388.  
  389.  
  390. Example
  391. ...
  392. case WM_COMMAND:
  393. {
  394.     switch(wParam)
  395.     {
  396.         case STATUSBAR_ID:
  397.             switch(HIWORD(lParam))
  398.             {
  399.                 case SBN_LBUTTONDBLCLK:
  400.                     /* processing occurs here */
  401.                     break;
  402.             }
  403.     }
  404. }
  405. ...
  406.  
  407.  
  408.  
  409. Comments
  410. None
  411.  
  412.  
  413.  
  414. Return Value
  415. None
  416.  
  417.  
  418. Status Bar Notification Messages continued...
  419.  
  420. SBN_LBUTTONUP
  421.  
  422. This code specifies that the Status Bar control received a left button up message. The parent receives this code through the WM_COMMAND message from the control.
  423.  
  424. Parameter
  425. Description
  426.  
  427.  
  428.  
  429.  
  430. wParam
  431. Specifies the control ID of the Status Bar.
  432.  
  433.  
  434.  
  435.  
  436. lParam
  437. Contains the SBN_LBUTTONUP code in the high-order word.
  438.  
  439.  
  440.  
  441. Example
  442. ...
  443. case WM_COMMAND:
  444. {
  445.     switch(wParam)
  446.     {
  447.         case STATUSBAR_ID:
  448.             switch(HIWORD(lParam))
  449.             {
  450.                 case SBN_LBUTTONUP:
  451.                     /* processing occurs here */
  452.                     break;
  453.             }
  454.     }
  455. }
  456. ...
  457.  
  458.  
  459.  
  460. Comments
  461. None
  462.  
  463.  
  464.  
  465. Return Value
  466. None
  467.  
  468.  
  469. Status Bar Notification Messages continued...
  470.  
  471. SBN_MBUTTONDBLCLK
  472.  
  473. This code specifies that the Status Bar control received a middle button double-click. The parent receives this code through the WM_COMMAND message from the control.
  474.  
  475. Parameter
  476. Description
  477.  
  478.  
  479.  
  480.  
  481. wParam
  482. Specifies the control ID of the Status Bar.
  483.  
  484.  
  485.  
  486.  
  487. lParam
  488. Contains the SBN_MBUTTONDBLCLK code in the high-order word.
  489.  
  490.  
  491.  
  492. Example
  493. ...
  494. case WM_COMMAND:
  495. {
  496.     switch(wParam)
  497.     {
  498.         case STATUSBAR_ID:
  499.             switch(HIWORD(lParam))
  500.             {
  501.                 case SBN_MBUTTONDBLCLK:
  502.                     /* processing occurs here */
  503.                     break;
  504.             }
  505.     }
  506. }
  507. ...
  508.  
  509.  
  510.  
  511. Comments
  512. None
  513.  
  514.  
  515.  
  516. Return Value
  517. None
  518.  
  519.  
  520. Status Bar Notification Messages continued...
  521.  
  522. SBN_MBUTTONUP
  523.  
  524. This code specifies that the Status Bar control received a middle button up message. The parent receives this code through the WM_COMMAND message from the control.
  525.  
  526. Parameter
  527. Description
  528.  
  529.  
  530.  
  531.  
  532. wParam
  533. Specifies the control ID of the Status Bar.
  534.  
  535.  
  536.  
  537.  
  538. lParam
  539. Contains the SBN_MBUTTONUP code in the high-order word.
  540.  
  541.  
  542.  
  543. Example
  544. ...
  545. case WM_COMMAND:
  546. {
  547.     switch(wParam)
  548.     {
  549.         case STATUSBAR_ID:
  550.             switch(HIWORD(lParam))
  551.             {
  552.                 case SBN_MBUTTONUP:
  553.                     /* processing occurs here */
  554.                     break;
  555.             }
  556.     }
  557. }
  558. ...
  559.  
  560.  
  561.  
  562. Comments
  563. None
  564.  
  565.  
  566.  
  567. Return Value
  568. None
  569.  
  570.  
  571. Status Bar Notification Messages continued...
  572.  
  573. SBN_RBUTTONDBLCLK
  574.  
  575. This code specifies that the Status Bar control received a right button double-click. The parent receives this code through the WM_COMMAND message from the control.
  576.  
  577. Parameter
  578. Description
  579.  
  580.  
  581.  
  582.  
  583. wParam
  584. Specifies the control ID of the Status Bar.
  585.  
  586.  
  587.  
  588.  
  589. lParam
  590. Contains the SBN_RBUTTONDBLCLK code in the high-order word.
  591.  
  592.  
  593.  
  594. Example
  595. ...
  596. case WM_COMMAND:
  597. {
  598.     switch(wParam)
  599.     {
  600.         case STATUSBAR_ID:
  601.             switch(HIWORD(lParam))
  602.             {
  603.                 case SBN_RBUTTONDBLCLK:
  604.                     /* processing occurs here */
  605.                     break;
  606.             }
  607.     }
  608. }
  609. ...
  610.  
  611.  
  612.  
  613. Comments
  614. None
  615.  
  616.  
  617.  
  618. Return Value
  619. None
  620.  
  621.  
  622. Status Bar Notification Messages continued...
  623.  
  624. SBN_MBUTTONUP
  625.  
  626. This code specifies that the Status Bar control received a right button up message. The parent receives this code through the WM_COMMAND message from the control.
  627.  
  628. Parameter
  629. Description
  630.  
  631.  
  632.  
  633.  
  634. wParam
  635. Specifies the control ID of the Status Bar.
  636.  
  637.  
  638.  
  639.  
  640. lParam
  641. Contains the SBN_RBUTTONUP code in the high-order word.
  642.  
  643.  
  644.  
  645. Example
  646. ...
  647. case WM_COMMAND:
  648. {
  649.     switch(wParam)
  650.     {
  651.         case STATUSBAR_ID:
  652.             switch(HIWORD(lParam))
  653.             {
  654.                 case SBN_RBUTTONUP:
  655.                     /* processing occurs here */
  656.                     break;
  657.             }
  658.     }
  659. }
  660. ...
  661.  
  662.  
  663.  
  664. Comments
  665. None
  666.  
  667.  
  668.  
  669. Return Value
  670. None
  671.  
  672.  
  673. Status Bar Example Code
  674.  
  675. #include "stsbar.ext"
  676.  
  677. #define ID_STATUSBAR 2000
  678.  
  679. int PASCAL WinMain(...)
  680. {
  681. .
  682. .
  683. .
  684. hWndParent = CreateWindow(...);
  685.  
  686. // Initialize the Status Bar control
  687. StatusBarInit(hInstance);
  688.  
  689. // Create the Status Bar control
  690. hStatusBar = CreateWindow(    "StatusBarClass",
  691.                 NULL,
  692.                 WS_CHILD | SBS_BOTTOM,
  693.                 0,0,0,0,
  694.                 hWnd,
  695.                 ID_STATUSBAR,
  696.                 hInstance,
  697.                 NULL);
  698.  
  699. // The default styles for the Status Bar control are:
  700. // Flat Face Style, White Face Color, and Black Text
  701.  
  702. // To change any of these styles before showing the Status Bar
  703. // use SendMessage() calls to change any or all of these attributes
  704. // and make sure not to use WS_VISIBLE when creating the Status Bar
  705.  
  706. // For example, the following calls change the Status Bar to have a
  707. // gray 3D face with black text color
  708. SendMessage(hStatusBar, SBM_FACESTYLE, 0, (LONG)SBFS_3DFACE);
  709. SendMessage(hStatusBar, SBM_FACECOLOR, 0, (LONG)SBCLR_GRAY);
  710. SendMessage(hStatusBar, SBM_TEXTCOLOR, 0, (LONG)SBCLR_BLACK);
  711.  
  712. //Now show the Status Bar
  713. ShowWindow(hStatusBar, SW_SHOW);
  714. .
  715. .
  716. .
  717. }
  718.  
  719. LONG FAR PASCAL ParentWndProc(...)
  720. {
  721.     switch (message)
  722.     {
  723.         case WM_COMMAND:
  724.         {
  725.             switch (wParam)
  726.             {
  727.                 // How to change the face style in the Status Bar
  728.                 case IDM_FACESTYLE:
  729.                     SendMessage(hStatusBar, SBM_FACESTYLE, 0, 
  730.                             (LONG)SBFS_FLATFACE);
  731.                 return 0;
  732.  
  733.                 // How to change the face color in the Status Bar
  734.                 case IDM_FACECOLOR:
  735.                     SendMessage(hStatusBar, SBM_FACECOLOR, 0, 
  736.                             (LONG)SBCLR_BLUE);
  737.                     or
  738.                     SendMessage(hStatusBar, SBM_FACECOLOR, 0, 
  739.                             (LONG)RGB(0, 0, 255));
  740.                 return 0;
  741.  
  742.                 // How to change the text color in the Status Bar
  743.                 case IDM_TEXTCOLOR:
  744.                     SendMessage(hStatusBar, SBM_TEXTCOLOR, 0, 
  745.                             (LONG)SBCLR_RED);
  746.                     or
  747.                     SendMessage(hStatusBar, SBM_TEXTCOLOR, 0, 
  748.                             (LONG)RGB(255, 0, 0));
  749.                 return 0;
  750.  
  751.                 // How to change the text font in the Status Bar
  752.                 case IDM_HELV8:
  753.                 {
  754.                     LOGFONT lf;
  755.  
  756.                     lf.lfHeight = 8;
  757.                     lf.lfWidth = 0;        // this field is ignored
  758.                     lf.lfEscapement = 0;    // this field is ignored
  759.                     lf.lfOrientation = 0;    // this field is ignored
  760.                     lf.lfWeight = 0;        // this field is ignored
  761.                     lf.lfItalic = 0;        // this field is ignored
  762.                     lf.lfUnderline = 0;    // this field is ignored
  763.                     lf.lfStrikeOut = 0;    // this field is ignored
  764.                     lf.lfCharSet = 0;        // this field is ignored
  765.                     lf.lfOutPrecision = 0;    // this field is ignored
  766.                     lf.lfClipPrecision = 0;    // this field is ignored
  767.                     lf.lfQuality = 0;        // this field is ignored
  768.                     lf.lfPitchAndFamily = 0;    // this field is ignored
  769.                     lstrcpy(lf.lfFaceName, "Helv");
  770.  
  771.                     SendMessage(hStatusBar, SBM_SETFONT, 0,
  772.                             (LONG)(LOGFONT)&lf);
  773.                 return 0;
  774.                 }
  775.  
  776.  
  777.                  // How to reset the font in the Status Bar to the default system font
  778.                 case IDM_DEFAULTSYSTEM:
  779.                     SendMessage(hStatusBar, SBM_SETFONT, 0, 0L);
  780.                 return 0;
  781.  
  782.                 // How to display text in the Status Bar
  783.                 case IDM_DISPLAYTEXT:
  784.                     SendMessage(hStatusBar, SBM_DISPLAYTEXT,
  785.                             (WORD)(SBTA_ITALICS | 
  786.                                 SBTA_UNDERLINE),
  787.                             (LONG)(LPSTR)lpszText);
  788.                 return 0;
  789.  
  790.                 // How to intercept mouse messages in the Status Bar
  791.                 case ID_STATUSBAR:
  792.                     switch (HIWORD(lParam))
  793.                     {
  794.                         // How to intercept a left mouse button up in the 
  795.                         // Status Bar
  796.                         case SBN_LBUTTONUP:
  797.                         return 0;
  798.  
  799.                         // How to intercept a left mouse button double click
  800.                         // in the Status Bar
  801.                         case SBN_LBUTTONDBLCLK:
  802.                         return 0;
  803.                     }
  804.                 return 0;
  805.             }
  806.         }
  807.         return 0;
  808.  
  809.         // How to size the Status Bar
  810.         case WM_SIZE:
  811.             if (hStatusBar)
  812.                 SendMessage(hStatusBar, SBM_SIZE, 0, lParam);
  813.         return 0;
  814.  
  815.         // How to uninitialize the Status Bar
  816.         case WM_DESTROY:
  817.             StatusBarUnInit(hInstance);
  818.             PostQuitMessage(0);
  819.         return 0;
  820.     }
  821.  
  822. return (DefWindowProc(...));
  823. }
  824. {PAGE|19}
  825.  
  826.  
  827.